﻿<Window x:Class="SequenceAssembler.Dialog.StartupScreen"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Height="430" Width="300"
        AllowsTransparency="True"    
        WindowStyle="None" 
        ResizeMode="NoResize"
        Background="Transparent" WindowStartupLocation="CenterScreen" ShowInTaskbar="False" 
        Icon="/SequenceAssembler;component/Resources/SequenceAssembler.ico">
    <Window.Template>
        <ControlTemplate TargetType="Window">
            <Border Name="windowBorder" Padding="9">
                <Border.Background>
                    <ImageBrush ImageSource="..\Resources\SequenceAssemblerStartUp.png" />
                </Border.Background>
                <ContentPresenter Content="{TemplateBinding Content}" />
            </Border>
        </ControlTemplate>
    </Window.Template>
    <Window.Resources>
        <ControlTemplate x:Key="closeButtonTemplate" TargetType="Button">
            <Border x:Name="closeButtonBorder" BorderThickness="2" BorderBrush="#CFFFFFFF" CornerRadius="8" Background="#58F5F5F5">
                <TextBlock x:Name="closeButtonText" Text="{TemplateBinding Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="#DC000000" />
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Background" Value="#95FFFFFF" TargetName="closeButtonBorder" />
                    <Setter Property="Foreground" Value="Black" TargetName="closeButtonText" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
    </Window.Resources>
   
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="160"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid>
            <StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="8,10">
                <Image Source="..\Resources\SAIconWithShadow.png" Stretch="Fill" Width="32" Height="32"/>
                <StackPanel VerticalAlignment="Center">
                    <TextBlock Text="{DynamicResource SequenceAssembly_Heading}" Margin="11,0,0,-10" Foreground="#FF494949" TextWrapping="Wrap" FontSize="10" FontWeight="Bold"/>
                    <TextBlock Text="{DynamicResource SequenceAssembly_SequenceAssembler}" TextWrapping="Wrap" FontSize="18" FontWeight="Bold"/>
                </StackPanel>
            </StackPanel>
            <TextBlock Grid.Row="1" Margin="10,45,10,10" TextWrapping="Wrap" FontSize="10" VerticalAlignment="Top" Text="{DynamicResource StartupScreen:aboutDetails}" />
            <StackPanel Grid.Row="3" Margin="0,110,0,0">
                <TextBlock Text="{DynamicResource AboutDialog_MicrosoftCopyright}" TextWrapping="Wrap" FontSize="10" HorizontalAlignment="Center" Opacity=".7"/>
                <TextBlock Text="{DynamicResource AboutDialog_QUTCopyright}" TextWrapping="Wrap" FontSize="10" HorizontalAlignment="Center" Opacity=".7"/>
                <TextBlock Text="{DynamicResource AboutDialog_RightsReserved}" TextWrapping="Wrap" FontSize="10" HorizontalAlignment="Center" Opacity=".7"/>
            </StackPanel>
        </Grid>
        <DockPanel Grid.Row="1">
            <Grid DockPanel.Dock="Bottom">
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="auto" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
                <Border BorderThickness="0,2,0,2" UseLayoutRounding="True">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                            <GradientStop Color="#CC313941" Offset="0" />
                            <GradientStop Color="Transparent" Offset="1" />
                        </LinearGradientBrush>
                    </Border.Background>
                    <TextBlock Text="{DynamicResource StartupScreen:recentFiles}" Grid.Row="0" Padding="12,0,0,1" FontWeight="Normal" FontSize="13" Foreground="White" />
                    <Border.BorderBrush>
                        <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                            <GradientStop Color="White" Offset="0" />
                            <GradientStop Color="Transparent" Offset=".8" />
                        </LinearGradientBrush>
                    </Border.BorderBrush>
                </Border>
                <StackPanel x:Name="recentFilespanel" Grid.Row="1" Margin="0,0,0,10">
                    <StackPanel.Resources>
                        <Style TargetType="Button">
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="Button">
                                        <Grid>
                                            <Border x:Name="recentFilenameBox" Background="White" Opacity="0" />
                                            <TextBlock Text="{TemplateBinding Content}" Foreground="#3f3f3f" Padding="20,3,20,3" x:Name="recentFilename" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/>
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsMouseOver" Value="true">
                                                <Setter Property="Opacity" Value=".5" TargetName="recentFilenameBox" />
                                                <Setter Property="Foreground" Value="Black" TargetName="recentFilename" />
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </StackPanel.Resources>
                </StackPanel>

                <Button Content="{DynamicResource StartupScreen:openFile}" Grid.Row="2" Click="OnOpenClick">
                    <Button.Template>
                        <ControlTemplate TargetType="Button">
                            <Border x:Name="highlightBackground" Padding="0,3,0,3" BorderThickness="0,2,0,2">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                        <GradientStop Color="#BD899AAA" Offset="0" />
                                        <GradientStop Color="Transparent" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Border.BorderBrush>
                                    <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                        <GradientStop Color="White" Offset="0" />
                                        <GradientStop Color="Transparent" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="56"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <Viewbox Width="20">
                                        <Grid>
                                            <Rectangle Fill="#FFBCBCBC" Margin="0.074,7.051,3.864,1.928" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat" Stroke="Black" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter" RadiusX="2" RadiusY="2"/>
                                            <Path Data="M0.5,0.5 L11.563704,0.5 16.875,5.0094095 16.875,21.875 0.5,21.875 z" Fill="#FFBCBCBC" Margin="4.699,0.176,7.114,7.803" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="Black" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter"/>
                                            <Path Data="M0.5,0.5 L11.563704,0.5 16.875,5.0094095 16.875,21.875 0.5,21.875 z" Margin="5.616,1.147,8.031,9.194" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="White" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter"/>
                                            <Path Data="M105.75,198.125 L129.875,198.125 130.75348,183.0811 C130.79398,182.3874 130.87535,182.08277 130.33376,181.49972 129.85239,180.98148 129.48611,181 128.79167,181 L118.95833,181 C118.47222,181 118.0638,181.01643 117.76583,181.3593 117.45333,181.71888 117.5,181.97222 117.5,182.45833 117.5,182.84722 117.57853,183.20299 117.32833,183.42181 117.0673,183.65009 116.58369,183.60703 116.12553,183.59805 L106.83417,183.41587 C106.13944,183.40224 105.67199,183.51556 105.25004,184.10931 104.84084,184.68512 104.86299,185.04154 104.91948,185.87481 z" Fill="#FFBCBCBC" Margin="2.088,12.051,0.206,0.178" StrokeStartLineCap="Flat" Stretch="Fill" StrokeEndLineCap="Flat" Stroke="Black" StrokeThickness="1" StrokeMiterLimit="10" StrokeLineJoin="Miter"/>
                                        </Grid>
                                    </Viewbox>
                                    <TextBlock Grid.Column="1" Text="{TemplateBinding Content}" Margin="-5,0,0,0" Padding="0,0,0,2" VerticalAlignment="Center" />
                                </Grid>
                            </Border>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background" TargetName="highlightBackground">
                                        <Setter.Value>                                            
                                            <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                                                <GradientStop Color="#CAFFFFFF" Offset="0" />
                                                <GradientStop Color="Transparent" Offset="1" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Button.Template>
                </Button>

                <Button Grid.Row="3" Content="{DynamicResource StartupScreen:close}" Width="70" HorizontalAlignment="Right" Margin="0,10,15,10" Click="OnCloseClick" Template="{StaticResource closeButtonTemplate}" IsDefault="True" IsCancel="True" TabIndex="0" />
            </Grid>
        </DockPanel>
    </Grid>
</Window>
